package com.example.getaudit.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serial;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 商品区域参考价月表
 *
 * @author 
 * @since 2025/03/19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString
@TableName("new_commodity_market_price_monthly")
@Schema(name = "CommodityMarketPriceMonthly", description = "商品区域参考价月表")
public class CommodityMarketPriceMonthly extends Model<CommodityMarketPriceMonthly> {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "商品条码(BCD)")
    @JSONField(name = "product_id")
    @TableField("product_id")
    private String productId;

    @Schema(description = "大区编码")
    @JSONField(name = "region_code")
    @TableField("region")
    private String region;

    @Schema(description = "进价25分位")
    @TableField("p1")
    private BigDecimal p1;

    @Schema(description = "进价50分位")
    @TableField("p2")
    private BigDecimal p2;

    @Schema(description = "进价75分位")
    @TableField("p3")
    private BigDecimal p3;

    @Schema(description = "拉取状态：0->未拉取；1->已拉取")
    @TableField("check_flag")
    private Boolean checkFlag;

    @Schema(description = "创建时间")
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
